<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.webamc.common.enums.Fields" %>
<%@ page import="com.webamc.common.enums.Params" %>
<%@ page import="com.webamc.model.Customer" %>
<%@ page import="com.webamc.model.CustomerInfo" %>
<%@ page import="com.webamc.util.CommonUtil" %>

<link rel="stylesheet" href="../webamc.css"/>
<div class="action-header">CUSTOMER</div>
<jsp:include page="msgs.jsp"/>
<table class="browse-table" border="1">
    <col width="10%"/>
    <col width="20%"/>
    <%
        Customer c = (Customer) request.getAttribute(Params.BEAN);
        if (c == null) {
    %>
    No customer! <a href="customer.html?action=browse">click here</a> to browse list.
    <%
            return;
        }

        CustomerInfo ui = c.getInfo();
    %>
    <tr>
        <td>CustomerId</td>
        <td><%=c.getCustomerId()%>
        </td>
    </tr>
    <tr>
        <td>Name</td>
        <td><%=CommonUtil.out(ui.getFullName())%>
        </td>
    </tr>
    <tr>
        <td>Category</td>
        <td><%=CommonUtil.out(c.getCategory())%>
        </td>

    </tr>
    <tr>
        <td>Status</td>
        <td><%=CommonUtil.out(c.getStatus())%>
        </td>
    </tr>
    <tr>
        <td>Start Date</td>
        <td><%=CommonUtil.getDateString(c.getStartTime())%>
        </td>
    </tr>
    <tr>
        <td>End Date</td>
        <td><%=CommonUtil.getDateString(c.getEndTime())%>
        </td>
    </tr>
    <tr>
        <td>DoB</td>
        <td><%=CommonUtil.getDateString(ui.getDob())%>
        </td>
    </tr>
    <tr>
        <td>Gender</td>
        <td><%=CommonUtil.out(ui.getGender())%>
        </td>
    </tr>
    <tr>
        <td>Contacts</td>
        <td><%=CommonUtil.out(ui.getContacts())%>
        </td>
    </tr>
    <tr>
        <td>Mobile</td>
        <td><%=CommonUtil.out(ui.getMobile())%>
        </td>
    </tr>
    <tr>
        <td>email</td>
        <td><%=CommonUtil.out(ui.getEmails())%>
        </td>
    </tr>
    <tr>
        <td>Address</td>
        <td><%=CommonUtil.out(ui.getAddress())%>
        </td>
    </tr>
    <tr>
        <td>City</td>
        <td><%=CommonUtil.out(ui.getCity())%>
        </td>
    </tr>
    <tr>
        <td>State</td>
        <td><%=CommonUtil.out(ui.getState())%>
        </td>
    </tr>
    <tr>
        <td>Description</td>
        <td><%=CommonUtil.out(ui.getDescription())%>
        </td>
    </tr>
    <tr>
        <td colspan="2" align="center">
            <a href="customer.html?action=beforeUpdate&<%=Fields.CUSTOMERID%>=<%=c.getCustomerId()%>">
                Update
            </a>
        </td>
    </tr>
</table>

